<?php

/**
JQueryMoblie PHP framework
@author Ludovit Scholtz <ludovit _at_ scholtz _dot_ sk>
@copyright Copyright (c) 2013, Ludovit Scholtz
@license http://www.gnu.org/licenses/gpl.html GNU Public License
@package JQM
@version 1.0.1
@since 1.0.0

*/


namespace JQM;


class Attribute{
	protected $value;
	public function get(){
		return $this->value;
	}
}
/** id attribute of the element */
class ID extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** theme of the widget a|b|c|d|e|f */
class Theme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Content theme of the widget a|b|c|d|e|f */
class ContentTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** header as ui-bar */
class UIBar extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** html class of an element. Element can have several classes defined */
class TClass extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** href of an anchor */
class Href extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** data icon of a widget gear|check|delete|.. */
class Icon extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** default inner html or text of the element */
class InnerHtml extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Rel for a button  */
class Rel extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}


class Tag{
	protected $id;
	protected $theme;
	protected $tagname = "";
	protected $attributes = array();
	protected $innerhtml = "";
	
	protected function build(){
		if($this->id) $this->attributes["id"] = $this->id;
		if($this->theme) $this->attributes["data-theme"] = $this->theme;
	}
	public function show(){
		$this->build();
		if(!$this->tagname) return "";
		$ret="<".$this->tagname;
		foreach($this->attributes as $k=>$v){
			if(is_array($v)){
				$value = "";
				foreach($v as $v2){
					if($value) $value.= " ";
					$value .= $v2;
				}
				$v = $value;
			}
			$ret.=' '.$k.'="'.($v).'"';//urlencode
		}
		$ret.='>';
		
		$ret.=$this->innerhtml;
		$ret.='</'.$this->tagname.'>';
		return $ret;
	}
	public function append($html){
		if(is_a($html,"JQM\Tag")){
			$this->innerhtml .= $html->show();
		}elseif(is_a($html,"JQM\Attribute")){
			$this->innerhtml .= $html->get();
		}elseif(is_string($html)){
			$this->innerhtml .= $html;
		}else{
			$this->innerhtml .= '<!-- Content not appended -->';
		}
	}
	public function set($attribute){
		$ret = false;
		if(is_a($attribute,"JQM\ID")){$ret=true;
			$this->id = $attribute->get();
		}
		if(is_a($attribute,"JQM\Theme")){$ret=true;
			$this->theme = $attribute->get();
		}
		if(is_a($attribute,"JQM\TClass")){$ret=true;
			$this->attributes["class"][$attribute->get()] = $attribute->get();
		}
		if(is_a($attribute,"JQM\InnerHtml")){$ret=true;
			$this->innerhtml .= $attribute->get();
		}
		if(is_string($attribute)){$ret=true;
			$this->innerhtml .= $attribute;
		}
		if(is_a($attribute,"JQM\Tag")){$ret=true;
			$this->append($attribute->show());
		}
		return $ret;
	}
}
class HeaderButton extends Tag{
	protected $href="";
	protected $icon="";
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Href")){
			$this->href = $attribute->get();
		}
		if(is_a($attribute,"JQM\Icon")){
			$this->icon = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "a";
		if($this->href) $this->attributes["href"] = $this->href;
		if($this->icon) $this->attributes["data-icon"] = $this->icon;
	}
}
class CloseHeaderButton extends HeaderButton{
	protected function build(){
		parent::build();
		$this->attributes["data-icon"] = "delete";
		$this->attributes["data-rel"] = "back";
	}
}
/** To enable this behavior on a header or footer, add the data-position="fixed" attribute to a jQuery Mobile header or footer element.  */
class Position extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Fullscreen fixed toolbars sit on top of the content at all times when they are visible, and unlike regular fixed toolbars, fullscreen toolbars do not fall back to static positioning when toggled. Instead they disappear from the screen entirely. Fullscreen toolbars are ideal for more immersive interfaces, like a photo viewer that is meant to fill the entire screen with the photo itself and no distractions.

To enable this option on a fixed header or footer, add the data-fullscreen attribute to the element. */
class Fullscreen extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Enable or disable the user's ability to toggle toolbar visibility with a tap on the screen (or a click, for mouse users).

This option is also exposed as a data attribute: data-tap-toggle="false".*/

class TapToggle extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** The transition that should be used for showing and hiding a fixed toolbar. Possible values are "none", "fade", and "slide" (or you can write a CSS transition of your own and use that too).

This option is also exposed as a data attribute: data-transition="fade".*/

class Transition extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Since toolbars can vary in height depending on the content they contain, this option automatically updates the padding on the page element to ensure that fixed toolbars have adequate space in the document when they are statically positioned, and when scrolled to the top or bottom of the page. When enabled, the padding updates during many operations, such as pageshow, during page transitions, and on resize and orientationchange. As an optimization, we would recommend that you consider disabling this option and adding a rule to your CSS to set the padding of the page div to match the EM height of your toolbars, such as .ui-page-header-fixed { padding-top: 4.5em; }.

This option is also exposed as a data attribute: data-update-page-padding="false".
*/

class UpdatePagePadding extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** This determines whether the toolbar is visible or not when its parent page is shown.

This option is also exposed as a data attribute: data-visible-on-page-show="false".
*/

class VisibleOnPageShow extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}


class Header extends Tag{
	
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\UIBar")){
			if($attribute->get()) $this->set(new TClass("ui-bar"));
		}
		if(is_a($attribute,"JQM\HeaderButton")){
			$this->append($but = $attribute->show());
		}
		if(is_a($attribute,"JQM\Position")){
			$this->attributes["data-position"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Fullscreen")){
			$this->attributes["data-fullscreen"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TapToggle")){
			$this->attributes["data-tap-toggle"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Transition")){
			$this->attributes["data-transition"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\UpdatePagePadding")){
			$this->attributes["data-update-page-padding"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\VisibleOnPageShow")){
			$this->attributes["data-visible-on-page-show"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "header";
	}
}

class Footer extends Tag{
	
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\UIBar")){
			if($attribute->get()) $this->set(new TClass("ui-bar"));
		}
		if(is_a($attribute,"JQM\HeaderButton")){
			$this->append($but = $attribute->show());
		}
		if(is_a($attribute,"JQM\Position")){
			$this->attributes["data-position"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Fullscreen")){
			$this->attributes["data-fullscreen"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TapToggle")){
			$this->attributes["data-tap-toggle"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Transition")){
			$this->attributes["data-transition"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\UpdatePagePadding")){
			$this->attributes["data-update-page-padding"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\VisibleOnPageShow")){
			$this->attributes["data-visible-on-page-show"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "footer";
	}
}

/** default inner html or text of the element */
class Corners extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Positions the icon in the button. Possible values: left, right, top, bottom, none, notext. The notext value will display an icon-only button with no text feedback.  */
class Iconpos extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** iconshadowType: Boolean
Default: true
Applies the theme shadow to the select button if set to true.

This option is also exposed as a data attribute: data-iconshadow="false".
 */
class Iconshadow extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false.  */
class Inline extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** If set to true, this will display a more compact version of the button that uses less vertical height. Possible values: true, false.  */
class Mini extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Applies the drop shadow style to the button if set to true.  */
class Shadow extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** 
Button: Type of a button. link|button|input|submit|reset Default: link  
ControlGroup: horizontal|vertical Default: vertical
ListView: ul|ol Default: ul
*/
class ButtonType extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** 
ControlGroup: horizontal|vertical Default: vertical
ListView: ul|ol Default: ul
Slider: input|select Default: input
*/
class Type extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Value for the input element  */
class Value extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Name for the input element  */
class Name extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

class Button extends Tag{
	protected $type="link";
	
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Icon")){
			$this->attributes["data-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Iconpos")){
			$this->attributes["data-iconpos"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Iconshadow")){
			$this->attributes["data-iconshadow"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Inline")){
			$this->attributes["data-inline"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Shadow")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ButtonType")){
			$this->type = $attribute->get();
		}
		if(is_a($attribute,"JQM\Value")){
			$this->attributes["value"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Name")){
			$this->attributes["name"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Href")){
			$this->attributes["href"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Rel")){
			$this->attributes["data-rel"] = $attribute->get();
		}
		
	}
	protected function build(){
		parent::build();
		switch($this->type){
			case "link":
				$this->tagname = "a";
				$this->attributes["data-role"] = "button";
			break;
			
			case "button":
				$this->tagname = "button";
			break;
			case "input":
				$this->tagname = "input";
				$this->attributes["type"] = "button";
			break;
			case "submit":
				$this->tagname = "input";
				$this->attributes["type"] = "submit";
			break;
			case "reset":
				$this->tagname = "input";
				$this->attributes["type"] = "reset";
			break;
		}
	}
}

class CheckBox extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Name")){
			$this->attributes["name"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Value")){
			$this->attributes["value"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "input";
		$this->attributes["type"] = "checkbox";
	}
}
/** To expand the content when the page loads, add the data-collapsed="false" attribute to the wrapper.  */
class Collapsed extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** By default collapsibles have an inset appearance. To make them full width without corner styling add the data-inset="false" attribute to the element. */
class Inset extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. In the below case, data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d".  */
class CollapsedIcon extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** Collapsible headings’ default icons can be overridden by using the data-collapsed-icon and data-expanded-icon attributes. In the below case, data-collapsed-icon="arrow-r" and data-expanded-icon="arrow-d". */
class ExpandedIcon extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

class Collapsible extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Collapsed")){
			$this->attributes["data-collapsed"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Inset")){
			$this->attributes["data-inset"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\CollapsedIcon")){
			$this->attributes["data-collapsed-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ExpandedIcon")){
			$this->attributes["data-expanded-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Iconpos")){
			$this->attributes["data-iconpos"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ContentTheme")){
			$this->attributes["data-content-theme"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "collapsible";
	}
}
class CollapsibleSet extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Collapsed")){
			$this->attributes["data-collapsed"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Inset")){
			$this->attributes["data-inset"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\CollapsedIcon")){
			$this->attributes["data-collapsed-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ExpandedIcon")){
			$this->attributes["data-expanded-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Iconpos")){
			$this->attributes["data-iconpos"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ContentTheme")){
			$this->attributes["data-content-theme"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "collapsible-set";
	}
}

/** 

Sets whether to exclude invisible children in the assignment of rounded corners.

When set to false, all children of a controlgroup are taken into account when assigning rounded corners, including hidden children. Thus, if, for example, the controlgroup's first child is hidden, the controlgroup will, in effect, not have rounded corners on the top edge.

This option is also exposed as a data attribute: data-exclude-invisible="false".
 */
class ExcludeInvisible extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class ControlGroup extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ExcludeInvisible")){
			$this->attributes["data-exclude-invisible"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Shadow")){
			$this->attributes["data-shadow"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Type")){
			$this->attributes["data-type"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "controlgroup";
	}
}
class FieldsetControlGroup extends ControlGroup{
	protected function build(){
		parent::build();
		$this->tagname = "fieldset";
		$this->attributes["data-role"] = "controlgroup";
	}
}
/** In cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items - the list item and a small arrow icon in the far right. To make a split list item, simply add a second link inside the li and the framework will add a vertical divider line, style the link as an icon-only arrow button, and set the title attribute of the link to the text of the link for accessibility.

You can set the icon for the right split icon by specifying a data-split-icon attribute on the listview with an icon name you want. The default icon is "arrow-r" but can be configured with the splitIcon listview option. By adding a data-icon attribute to the list item, you can set individual icons for each split. The theme swatch color of the split button defaults to "b" (blue in the default theme) but can be set by specifying a swatch letter with the data-split-theme attribute at the listview level or for individual splits with the data-theme attribute at the link level.

 */
class SplitIcon extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class SplitTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** A listview can be configured to automatically generate dividers for its items. This is done by adding a data-autodividers="true" attribute to any listview.

By default, the text used to create dividers is the uppercased first letter of the item's text. Alternatively you can specify divider text by setting the autodividersSelector option on the listview programmatically. For example, to add a custom selector to the element with id="mylistview":
*/
class Autodividers extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data attribute data-filter-theme on your listview.
*/
class Filter extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data attribute data-filter-theme on your listview.
*/
class FilterPlaceholder extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the data-filter="true" attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data attribute data-filter-placeholder on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data attribute data-filter-theme on your listview.
*/
class FilterTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** To filter list items by values other than the text, add a data-filtertext attribute to the list item. The value of this attribute will be passed as the first argument to the filterCallback function instead of the text. Alternately you can use an attribute of your choosing as defined on the list item itself.
*/
class FilterText extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/** The filter reveal feature makes is easy to build a simple autocomplete with local data. When a filterable list has the data-filter-reveal="true" attribute, it will auto-hide all the list items when the search field is blank. The data-filter-placeholder attribute can be added to specify the placeholder text for the filter. If you need to search against a long list of values, we provide a way to create a filter with a remote data source.
*/
class FilterReveal extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**  Default: "c"
Sets the color scheme (swatch) for list item count bubbles. It accepts a single letter from a-z that maps to one of the swatches included in your theme.

This option is also exposed as a data attribute: data-count-theme="a".

*/
class CountTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   Default: "b"
Sets the color scheme (swatch) for list dividers. It accepts a single letter from a-z that maps to one of the swatches included in your theme.

This option is also exposed as a data attribute: data-divider-theme="a".

*/
class DividerTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class ListView extends Tag{
	protected $type = "ul";
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		if(is_a($attribute,"JQM\Autodividers")){
			$this->attributes["data-autodividers"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\CountTheme")){
			$this->attributes["data-count-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\DividerTheme")){
			$this->attributes["data-divider-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Filter")){
			$this->attributes["data-filter"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\FilterPlaceholder")){
			$this->attributes["data-filter-placeholder"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\FilterTheme")){
			$this->attributes["data-filter-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\FilterText")){
			$this->attributes["data-filtertext"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\FilterReveal")){
			$this->attributes["data-filter-reveal"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\SplitIcon")){
			$this->attributes["data-split-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\SplitTheme")){
			$this->attributes["data-split-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Inset")){
			$this->attributes["data-inset"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Icon")){
			$this->attributes["data-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Type")){
			$this->type = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = $this->type;
		$this->attributes["data-role"] = "listview";
	}
}
class CleanListView extends ListView{
	protected function build(){
		parent::build();
		$this->tagname = $this->type;
		unset($this->attributes["data-role"]);
	}
}

class LI extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "li";
	}
}


class Navbar extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Iconpos")){
			$this->attributes["data-iconpos"] = $attribute->get();
		}
		
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "navbar";
	}
}


/**    Default: false

Sets whether to keep the page in the DOM after the user has navigated away from it.

This option is also exposed as a data attribute: data-dom-cache="true".

*/
class DomCache extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

/**   keepNativeDefaultType: String
Default: :jqmData(role='none'), :jqmData(role='nojs')

The value of this option is a selector that will be used to prevent elements matching it from being enhanced.

This option is also exposed as a data attribute: data-keep-native-default=".do-not-enhance".

*/
class KeepNativeDefault extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

class Page extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\DomCache")){
			$this->attributes["data-dom-cache"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\KeepNativeDefault")){
			$this->attributes["keep-native-default"] = $attribute->get();
		}
		
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "page";
	}
}

/**   dismissibleType: Boolean
Default: true
Sets whether the panel can be closed by clicking outside onto the page.

This option is also exposed as a data attribute:data-dismissible="false" on the link that opens the panel.

*/
class Dismissible extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   animateType: Boolean
Default: true
Sets whether the panel will animate when opening and closing. If set to false, the panel will just appear and disappear without animation. This is recommended for fastest performance.

This option is also exposed as a data attribute:data-animate="false" on the panel container.

*/
class Animate extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   displayType: String
Default: "reveal"
The relationship of the panel to the page contents. Can either push the page over ("reveal"), re-flow the content to fit the panel content as a column ("push"), or sit over the content ("overlay").

This option is also exposed as a data attribute:data-display="push" on the link that opens the panel.

*/
class Display extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

/**   positionFixedType: Boolean
Default: false
Sets whether the panel has fixed positioning so the contents are in view even if the page is scrolled down. This also allows the page to scroll while the panel stays fixed. We recommend not to enable this feature when panels are used within Android apps because of poor performance and display issues.

This option is also exposed as a data attribute:data-position-fixed=true on the panel.

*/
class PositionFixed extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

/**   swipeCloseType: Boolean
Default: true
Sets whether the panel can be closed by swiping left or right over the panel.

This option is also exposed as a data attribute:data-swipe-close=false on the panel.

*/
class SwipeClose extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

class Panel extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Animate")){
			$this->attributes["data-animate"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Dismissible")){
			$this->attributes["data-dismissible"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Display")){
			$this->attributes["data-display"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Position")){
			$this->attributes["data-position"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\PositionFixed")){
			$this->attributes["data-position-fixed"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\SwipeClose")){
			$this->attributes["data-swipe-close"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "panel";
	}
}

/**   historyType: Boolean
Default: true

Sets whether to alter the url when a popup is open to support the back button.

This option is also exposed as a data attribute: data-history="false".

*/
class History extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   overlayThemeType: String
Default: null

Sets the color scheme (swatch) for the popup background, which covers the entire window. If not explicitly set, the background will be transparent.

This option is also exposed as a data attribute: data-overlay-theme="a".

*/
class OverlayTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   positionToType: String
Default: "origin"

Sets the element relative to which the popup will be centered. It has the following values:
"origin" 	When the popup opens, center over the coordinates passed to the open() call (see details on this method).
"window" 	When the popup opens, center in the window.
jQuery selector 	When the popup opens, create a jQuery object based on the selector, and center over it. The selector is filtered for elements that are visible with ":visible". If the result is empty, the popup will be centered in the window.

This option is also exposed as a data attribute: data-position-to="window".

*/
class PositionTo extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}

class Popup extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Dismissible")){
			$this->attributes["data-dismissible"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\History")){
			$this->attributes["data-history"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\OverlayTheme")){
			$this->attributes["data-overlay-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\PositionTo")){
			$this->attributes["data-position-to"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Shadow")){
			$this->attributes["data-shadow"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Transition")){
			$this->attributes["data-transition"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "popup";
	}
}
/**   disabledType: Boolean
Default: false
Sets the default state of the rangeslider to disabled when "true".
*/
class Disabled extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   highlightType: Boolean
Default: true
Sets an active state fill on the track between the two rangeslider handles when set to "true".
*/
class Highlight extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   trackThemeType: String
Default: null, inherited from parent
Sets the color scheme (swatch) for the slider's track, specifically. It accepts a single letter from a-z that maps to the swatches included in your theme.

Possible values: swatch letter (a-z).

This option can be overridden in the markup by assigning a data attribute to the input, e.g. data-track-theme="a".

*/
class TrackTheme extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class RangeSlider extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Disabled")){
			$this->attributes["data-disabled"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Highlight")){
			$this->attributes["data-highlight"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TrackTheme")){
			$this->attributes["data-track-theme"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "rangeslider";
	}
}

/**   nativeMenuType: Boolean
Default: true
When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu.

This option is also exposed as a data attribute: data-native-menu="false".

*/
class NativeMenu extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   preventFocusZoomType: Boolean
Default: true on iOS platforms
This option disables page zoom temporarily when a custom select is focused, which prevents iOS devices from zooming the page into the select. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts.

This option is also exposed as a data attribute: data-prevent-focus-zoom="true".

*/
class PreventFocusZoom extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class Selectmenu extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Corners")){
			$this->attributes["data-corners"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Icon")){
			$this->attributes["data-icon"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Iconpos")){
			$this->attributes["data-iconpos"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\IconShadow")){
			$this->attributes["data-iconshadow"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Inline")){
			$this->attributes["data-inline"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\NativeMenu")){
			$this->attributes["data-native-menu"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\PreventFocusZoom")){
			$this->attributes["data-prevent-focus-zoom"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Shadow")){
			$this->attributes["data-shadow"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Name")){
			$this->attributes["data-name"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "select";
		
	}
}
/**   Minimum value
*/
class Min extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   Maximum value
*/
class Max extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class Slider extends Tag{
	protected $type = "input";
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Mini")){
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TrackTheme")){
			$this->attributes["data-track-theme"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Min")){
			$this->attributes["data-min"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Max")){
			$this->attributes["data-max"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Highlight")){
			$this->attributes["data-highlight"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Type")){
			$this->type = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		if($this->type == "select"){
			$this->attributes["data-role"] = "slider";
		}
		$this->tagname = $this->type;
		
	}
}
/**   Table mode reflow|columntoggle
*/
class Mode extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class Table extends Tag{
	protected $headers = array();
	protected $rows = array();
	public function __construct(){
		$args = func_get_args();	
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Mode")){
			$this->attributes["data-mode"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TH")){
			$this->headers[] = $attribute->get();
		}
		if(is_a($attribute,"JQM\TR")){
			$this->rows[] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->attributes["data-role"] = "table";
		$this->tagname = "table";
		
		if($this->headers){
			$this->inlinehtml = "<thead><tr>";
			foreach($this->headers as $th){
				$this->inlinehtml .= $th->show();
			}
			$this->inlinehtml .= "</tr></thead><tbody>";
			
			foreach($this->rows as $tr){
				$this->inlinehtml .= $tr->show();
			}
			$this->inlinehtml .= "</tbody>";
			
		}
		
		
	}
}
/**   Table header priority
*/
class Priority extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class TH extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\Priority")){
			$this->attributes["data-priority"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "th";
		
	}
}

class TR extends Tag{
	protected $cols = array();
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\TD")){
			$this->cols[] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "tr";
		if($this->cols){
			$this->inlinehtml = "";
			foreach($this->cols as $td){
				$this->inlinehtml .= $td->show();
			}
		}
	}
}

class TD extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
	}
	protected function build(){
		parent::build();
		$this->tagname = "td";
	}
}


/**   clearBtnType: Boolean
Default: false
Adds a clear button to the input (not available for textareas).

This option is also exposed as a data attribute: data-clear-btn="true".

*/
class ClearBtn extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
/**   clearBtnTextType: String
Default: "clear text"
The text description for the optional clear button, useful for assistive technologies like screen readers.

This option is also exposed as a data attribute: data-clear-btn-text="Clear input".

*/
class ClearBtnText extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class Textinput extends Tag{
	protected $type = "input";
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\ClearBtn")){			
			$this->attributes["data-clear-btn"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\ClearBtnText")){			
			$this->attributes["data-clear-btn-text"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Mini")){			
			$this->attributes["data-mini"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\PreventFocusZoom")){			
			$this->attributes["data-prevent-focus-zoom"] = $attribute->get();
		}
		
		if(is_a($attribute,"JQM\Value")){
			$this->attributes["value"] = $attribute->get();
		}
		if(is_a($attribute,"JQM\Name")){
			$this->attributes["name"] = $attribute->get();
		}
		
		if(is_a($attribute,"JQM\Type")){			
			$this->type = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = $this->type;
	}
}
class Radio extends Textinput{
	
	protected function build(){
		parent::build();
		$this->tagname = $this->type;
		$this->attributes["type"] = "radio";
	}
}
class Content extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "content";
	}
}
class Fieldcontain extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->attributes["data-role"] = "fieldcontain";
	}
}
/**   Tfor .. label for=""
*/
class TFor extends Attribute{
	public function __construct($value){
		$this->value = $value;
	}
}
class Label extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
		
		if(is_a($attribute,"JQM\TFor")){
			$this->attributes["for"] = $attribute->get();
		}
	}
	protected function build(){
		parent::build();
		$this->tagname = "label";
	}
}


class TwoColumnLayout extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-grid-a"));
	}
}

class ThreeColumnLayout extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-grid-b"));
	}
}

class FourColumnLayout extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-grid-c"));

	}
}

class FiveColumnLayout extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-grid-d"));

	}
}

class SixColumnLayout extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-grid-e"));

	}
}

class Column1 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-a"));
	}
}
class Column2 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-b"));

	}
}
class Column3 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-c"));

	}
}
class Column4 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-d"));

	}
}
class Column5 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-e"));

	}
}
class Column6 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "div";
		$this->set(new TClass("ui-block-f"));

	}
}
class Legend extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "legend";
	}
}
class H1 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "h1";
	}
}
class H2 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "h2";
	}
}
class H3 extends Tag{
	public function __construct(){
		$args = func_get_args();		
		while(($arg = array_shift($args)) !== null){
			$this->set($arg);
		}
	}
	public function set($attribute){
		if(parent::set($attribute)) return true;
	}
	protected function build(){
		parent::build();
		$this->tagname = "h3";
	}
}
?>